package p.ithorns.example.task;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * TaskDetectionParam
 * 任务检测参数
 *
 * @author HtL
 * @date 2024/5/12 16:32
 * @since 1.0.0
 */
@Getter
@Setter
@Accessors(chain = true)
public class TaskDetectionParam {

    /**
     * 现在时间
     */
    private LocalDateTime current;
    /**
     * 初始执行时间
     */
    private LocalDateTime init;
    /**
     * 最近一次执行时间
     */
    private LocalDateTime last;
    /**
     * 执行周期
     */
    private Integer cycle;
    /**
     * 周期单位
     */
    private String cycleUnit;
    /**
     * 每日最任务数
     */
    private Integer dailyTasks;
    /**
     * 已执行次数
     */
    private Integer execCount;

    @Override
    public String toString() {
        return "{" +
                "init:" + init +
                ", last:" + last +
                ", now:" + current +
                ", cycleUnit:'" + cycleUnit + '\'' +
                ", cycle:" + cycle +
                ", dailyTasks:" + dailyTasks +
                ", execCount:" + execCount +
                "}";
    }
}